#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
const int M=1050;
const int INF=0x3f3f3f3f;
struct Edge{
    int from,to,cap,flow;
    Edge(int u,int v,int c,int f):from(u),to(v),cap(c),flow(f){}
};
int n,m;
vector<Edge> edges;
vector<int> G[M];
int a[M];
int p[M];
void init(){
    for(int i=0;i<M;i++){
        G[i].clear();
    }
    edges.clear();
}
void addEdge(int from,int to,int cap){
    edges.push_back(Edge(from,to,cap,0));
    edges.push_back(Edge(to,from,0,0));
    m=edges.size();
    G[from].push_back(m-2);
    G[to].push_back(m-1);
}
int maxFlow(int s,int t){
    int flow=0;
    while(true){
        memset(a,0,sizeof(a));
        queue<int> q;
        q.push(s);
        a[s]=INF;
        while(!q.empty()){
            int x=q.front();
            q.pop();
            for(int i=0;i<G[x].size();i++){
                Edge &e=edges[G[x][i]];
                if(!a[e.to] && e.cap >e.flow){
                    p[e.to]=G[x][i];
                    a[e.to]=min(a[x],e.cap-e.flow);
                    q.push(e.to);
                }
            }
            if(a[t]){
                break;
            }
        }
        if(!a[t]){
            break;
        }
        for(int u=t;u!=s;u=edges[p[u]].from){
            edges[p[u]].flow+=a[t];
            edges[p[u]^1].flow-=a[t];
        }
        flow+=a[t];
    }
    return flow;
}
int main(void){

    return 0;
}